Optimal. Leaf size=146 \[ \frac {\left (8 a^4+24 a^2 b^2+3 b^4\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a b \left (19 a^2+16 b^2\right ) \tan (c+d x)}{6 d}+\frac {b^2 \left (26 a^2+9 b^2\right ) \sec (c+d x) \tan (c+d x)}{24 d}+\frac {7 a b (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}+\frac {b (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.17, antiderivative size = 146, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.368, Rules used = {3915, 4087,
4082, 3872, 3855, 3852, 8} \begin {gather*} \frac {a b \left (19 a^2+16 b^2\right ) \tan (c+d x)}{6 d}+\frac {b^2 \left (26 a^2+9 b^2\right ) \tan (c+d x) \sec (c+d x)}{24 d}+\frac {\left (8 a^4+24 a^2 b^2+3 b^4\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {b \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}+\frac {7 a b \tan (c+d x) (a+b \sec (c+d x))^2}{12 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 3872
Rule 3915
Rule 4082
Rule 4087
Rubi steps
\begin {align*} \int \sec (c+d x) (a+b \sec (c+d x))^4 \, dx &=\frac {b (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {1}{4} \int \sec (c+d x) (a+b \sec (c+d x))^2 \left (4 a^2+3 b^2+7 a b \sec (c+d x)\right ) \, dx\\ &=\frac {7 a b (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}+\frac {b (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {1}{12} \int \sec (c+d x) (a+b \sec (c+d x)) \left (a \left (12 a^2+23 b^2\right )+b \left (26 a^2+9 b^2\right ) \sec (c+d x)\right ) \, dx\\ &=\frac {b^2 \left (26 a^2+9 b^2\right ) \sec (c+d x) \tan (c+d x)}{24 d}+\frac {7 a b (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}+\frac {b (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {1}{24} \int \sec (c+d x) \left (3 \left (8 a^4+24 a^2 b^2+3 b^4\right )+4 a b \left (19 a^2+16 b^2\right ) \sec (c+d x)\right ) \, dx\\ &=\frac {b^2 \left (26 a^2+9 b^2\right ) \sec (c+d x) \tan (c+d x)}{24 d}+\frac {7 a b (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}+\frac {b (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {1}{6} \left (a b \left (19 a^2+16 b^2\right )\right ) \int \sec ^2(c+d x) \, dx+\frac {1}{8} \left (8 a^4+24 a^2 b^2+3 b^4\right ) \int \sec (c+d x) \, dx\\ &=\frac {\left (8 a^4+24 a^2 b^2+3 b^4\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {b^2 \left (26 a^2+9 b^2\right ) \sec (c+d x) \tan (c+d x)}{24 d}+\frac {7 a b (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}+\frac {b (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}-\frac {\left (a b \left (19 a^2+16 b^2\right )\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{6 d}\\ &=\frac {\left (8 a^4+24 a^2 b^2+3 b^4\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a b \left (19 a^2+16 b^2\right ) \tan (c+d x)}{6 d}+\frac {b^2 \left (26 a^2+9 b^2\right ) \sec (c+d x) \tan (c+d x)}{24 d}+\frac {7 a b (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}+\frac {b (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.55, size = 101, normalized size = 0.69 \begin {gather*} \frac {3 \left (8 a^4+24 a^2 b^2+3 b^4\right ) \tanh ^{-1}(\sin (c+d x))+b \tan (c+d x) \left (9 b \left (8 a^2+b^2\right ) \sec (c+d x)+6 b^3 \sec ^3(c+d x)+32 a \left (3 \left (a^2+b^2\right )+b^2 \tan ^2(c+d x)\right )\right )}{24 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 147, normalized size = 1.01
method | result | size |
derivativedivides | \(\frac {a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 b \,a^{3} \tan \left (d x +c \right )+6 b^{2} a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-4 b^{3} a \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+b^{4} \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) | \(147\) |
default | \(\frac {a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 b \,a^{3} \tan \left (d x +c \right )+6 b^{2} a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-4 b^{3} a \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+b^{4} \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) | \(147\) |
norman | \(\frac {-\frac {b \left (32 a^{3}-24 b \,a^{2}+32 b^{2} a -5 b^{3}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {b \left (32 a^{3}+24 b \,a^{2}+32 b^{2} a +5 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {b \left (288 a^{3}-72 b \,a^{2}+160 b^{2} a +9 b^{3}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}-\frac {b \left (288 a^{3}+72 b \,a^{2}+160 b^{2} a -9 b^{3}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{4}}-\frac {\left (8 a^{4}+24 b^{2} a^{2}+3 b^{4}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {\left (8 a^{4}+24 b^{2} a^{2}+3 b^{4}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) | \(249\) |
risch | \(-\frac {i b \left (72 b \,a^{2} {\mathrm e}^{7 i \left (d x +c \right )}+9 b^{3} {\mathrm e}^{7 i \left (d x +c \right )}-96 a^{3} {\mathrm e}^{6 i \left (d x +c \right )}+72 a^{2} b \,{\mathrm e}^{5 i \left (d x +c \right )}+33 b^{3} {\mathrm e}^{5 i \left (d x +c \right )}-288 a^{3} {\mathrm e}^{4 i \left (d x +c \right )}-192 a \,b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-72 b \,a^{2} {\mathrm e}^{3 i \left (d x +c \right )}-33 b^{3} {\mathrm e}^{3 i \left (d x +c \right )}-288 a^{3} {\mathrm e}^{2 i \left (d x +c \right )}-256 a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-72 a^{2} b \,{\mathrm e}^{i \left (d x +c \right )}-9 b^{3} {\mathrm e}^{i \left (d x +c \right )}-96 a^{3}-64 b^{2} a \right )}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}+\frac {a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2} a^{2}}{d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{4}}{8 d}-\frac {a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2} a^{2}}{d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{4}}{8 d}\) | \(353\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 180, normalized size = 1.23 \begin {gather*} \frac {64 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} a b^{3} - 3 \, b^{4} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 72 \, a^{2} b^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 48 \, a^{4} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 192 \, a^{3} b \tan \left (d x + c\right )}{48 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.59, size = 163, normalized size = 1.12 \begin {gather*} \frac {3 \, {\left (8 \, a^{4} + 24 \, a^{2} b^{2} + 3 \, b^{4}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (8 \, a^{4} + 24 \, a^{2} b^{2} + 3 \, b^{4}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (32 \, a b^{3} \cos \left (d x + c\right ) + 6 \, b^{4} + 32 \, {\left (3 \, a^{3} b + 2 \, a b^{3}\right )} \cos \left (d x + c\right )^{3} + 9 \, {\left (8 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right )^{4} \sec {\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 360 vs.
\(2 (136) = 272\).
time = 0.46, size = 360, normalized size = 2.47 \begin {gather*} \frac {3 \, {\left (8 \, a^{4} + 24 \, a^{2} b^{2} + 3 \, b^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (8 \, a^{4} + 24 \, a^{2} b^{2} + 3 \, b^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (96 \, a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 72 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 96 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 15 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 288 \, a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 72 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 160 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 9 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 288 \, a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 72 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 160 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 9 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 96 \, a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 72 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 96 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 15 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.92, size = 245, normalized size = 1.68 \begin {gather*} \frac {\left (-8\,a^3\,b+6\,a^2\,b^2-8\,a\,b^3+\frac {5\,b^4}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (24\,a^3\,b-6\,a^2\,b^2+\frac {40\,a\,b^3}{3}+\frac {3\,b^4}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-24\,a^3\,b-6\,a^2\,b^2-\frac {40\,a\,b^3}{3}+\frac {3\,b^4}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (8\,a^3\,b+6\,a^2\,b^2+8\,a\,b^3+\frac {5\,b^4}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (2\,a^4+6\,a^2\,b^2+\frac {3\,b^4}{4}\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________